<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnAffectedByTaskInDelayOrderTaskTable extends AbstractMigration
{
    public function up()
    {
        $this->table("delay_order_task")
            ->addColumn('affected_by_task', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '影响本任务的 上游任务'])
            ->save();
    }

    public function down()
    {
        if ($this->table("delay_order_task")->hasColumn('affected_by_task')) {
            $this->table("delay_order_task")->removeColumn('affected_by_task')->save();
        }
    }
}
